define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Showdetail, $window, $timeout,$stateParams) {
		$scope.isLoad = false; //可以加载
		//画面加载
		$scope.$on('$ionicView.afterEnter', function() {
			//动态设置高度
			var all = $window.innerHeight;
			//计算滚动条
			$scope.myObj = {
				"height": all - 44 + "px"
			};
		}, false);

		//接受参数
		$scope.id = $stateParams.id;
		//加载数据
		$scope.init_data = function() {
			Showdetail.getlist($scope.id,function(data) {
				$scope.detail = data;
			});
		}
		$scope.init_data(); //必须在定义之后
	}

	controller.$inject = ['$scope', 'Showdetail', '$window', '$timeout', '$stateParams'];

	return app.registerController("showdetailctrl",controller);
});